import {resolve} from 'node:path';
import jsonLoader from "./loader/json-loader.js";
import cssLoader from "./loader/css-loader.js";

export default {
    entry: resolve('./example/main.js'),
    outputDir: resolve('./dist'),
    // graph: false,
    // outputFile: 'index.js',
    loader: [
        {
            test: /.json$/,
            use: [jsonLoader],
        },
        {
            test: /.css$/,
            use: [cssLoader],
            options: {
                injectStyle: true  // 相当于style-loader
            }
        }
    ],
    devServer: true,
    publicDir: true,
    alias: {
        '@': resolve('./example/src'),
        '~': resolve('./example/css')
    },
    watch: true,
}